This application is based upon and claims the benefit of priority from the prior Japanese Patent Application No. 11-294474, filed Oct. 15, 1999; the entire contents of which are incorporated herein by reference.
1. Field of the Invention
The present invention relates to an image processing device and an image processing method capable of performing image processing to obtain output image data without any occurrence of a chromaticity differentiation loss and jump in brightness and with enhancing a contrast of the image when a printing device such as a printer outputs the image data on a printing paper. When a dark picture or a light picture is output from a color image output means such as a printer which is narrow in color reproduction range, the chromaticity differentiation loss occurs in a dark part and the jump in brightness occurs in a light part in image data. Conventionally, such chromaticity differentiation loss and/or jump in brightness are prevented by enhancing gradation of an image represented by the image data obtained by a color image read-out means such as an image scanner by carrying out contrast enhancement processing on the image data.
2. Description of the Related Art
Various types of printers and copier machines have been developed previously, these printers of an ink-jet type and a laser type are capable of inputting images data transferred from a personal computer and the like and then printing the image data on a printing paper and so on, and these copier machines are capable of reading optional image by using an optical reader and then printing the image data onto a printing paper.
The image printing devices such as these printers and copier machines perform a contrast enhancement process based on a histogram uniformity method in order to avoid the missing of detailed edge information about the edge of an original image.
There is a local histogram uniformity method as one of general contrast enhancement methods. Because this method performs the contrast enhancement in accordance with a local information about an image, this method can be efficiently applied to the process for natural images that require local information.
However, because this method calculates a mapping curve (a density-value conversion curve) per pixel that is obtained by accumulating the histogram of density values, this method causes a drawback to require an enormous time for the operation.
In order to eliminate this conventional drawback, for example, there is a high-speed local contrast enhancement method for natural images as a prior technique. In this technique, the mapping curve is obtained per region, not per pixel, in order to decrease the processing time to make the histogram, namely in order to perform the making of the histogram at a high speed.
Next, a description will be given of an outline of the conventional technique as written above:
(1) At first, a plurality of density conversion curves have been designed in advance;
(2) Second, suppose the histograms are concentrated around a mean density, and select the density conversion curve according to the mean density (selects the density conversion curve so that the contrast around the mean density may be enhanced); and
(3) Finally, a linear interpolation for the density values is performed when the density conversion curves selected in adjacent regions are different.
By the way, in the conventional technique described above, although it has also been written that the density conversion curve is made per pixel, it is commonly and widely used to make the density conversion curve per block.
(A) Dividing input image into blocks, each block has a uniform size that has been experimentally determined.
(B) Following processes (B-1) to (B-3) are performed per block:
(B-1) Making a density histogram (in this case, each block is a reference region);
(B-2) Clipping the density histogram with a clip value that has been experimentally determined in order to obtain the density histogram after the olipping; and
(B-3) Making an accumulated histogram obtained by accumulating the density histograms after the clipping.
(C) Performing a density conversion per pixel in each block based on the accumulated histogram as the density conversion curve.
In particular, when the density conversion curve for the block including the target pixel is different from the density conversion curves for adjacent blocks, the following linear interpolation processes (C-1) to (C-3) are performed for the density values.
(C-1) Converting the density value for a target pixel by using the density conversion curve that is made in the block B1 including the target pixel, and obtaining the density value xe2x80x9cg1xe2x80x9d after the conversion;
(C-2) Converting the density value of the target pixel by using the density conversion curves selected in each of the blocks B2, B3, and B4 that are mostly adjacent to this target pixel, and obtaining the density values g2, g3, and g4 after the conversion; and
(C-3) Calculating the density value g(x,y) after the linear interpolation based on the following equation (1). (Each of the density values g1, g2, g3, and g4 after the conversion is weighted according to the distance from the center of each of the blocks B1, B2, B3, and B4 to the target pixel.)
g(x,y)={(Jxe2x88x92j)/J)}{(Ixe2x88x92i)g1/I+ig2/I}+j/J{(Ixe2x88x92i)g3/I+ig4/I}xe2x80x83xe2x80x83(1).
For the definition of each variable in the above-equation (1), see the detailed explanation for the same equation (1) that will be described in the xe2x80x9cDETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTxe2x80x9d section.
However, in the conventional technique xe2x80x9cA high-speed local oontrast enhancement method for natural imagesxe2x80x9d as written above, the reduction of the entire contrast of a target image occurs. For example, when a region A of a small area where the density value is low and a region B of a large area where the density value is high are mixed, and when the size of a reference area is then optimized based on the region A, the entire contrast of the region B is decreased and the contrast of a local area in the region B is enhanced.
On the contrary, when the size of the reference area is optimized based on the region B, because the size of the region A is very smaller than that of the reference area, the density information of the region A cannot be almost used when the histogram is calculated. This causes to decrease the slope of the density curve at a low density region and to decrease the contrast. After all, because the regions where the mapping curve is obtained are same, there is a drawback that it is difficult to set each region having an optimize size in the entire image to be processed.
Furthermore, it is preferable to determine a size of the reference area as a parameter to be used for determining the degree of enhancement for the detailed information, and a clip value as another parameter to be used for determining the degree of enhancement in the contrast according to the feature of a local region of the image. However, because there is no determination method to obtain these parameters in the prior technique, constant values as the parameters that have been experimentally obtained in advance are used. Therefore, it is desirable to automatically determine these parameters according to the feature of the local area of the target image.
According to the decreasing of the reference area, the wide-view contrast is also decreased because the local contrast is enhanced. On the contrary, according to the increasing of the reference area, the local contrast is also decreased because the wide-view contrast is enhanced. Furthermore, according to the increasing of the clip value, the degree of the enhancement is also increased, and according to the decreasing of the clip value, the degree of the enhancement is decreased.
Moreover, when the target image to be processed is switched, the above calculation for obtaining the optimum parameters must be repeated because the optimum parameters are also changed according to the switched image. This conventional drawback introduces inefficient calculation.
In addition to these conventional drawbacks, there is also a drawback in which an over-enhancement in contrast occurs when the dynamic range for the density in the image processing device is narrower than that of the original image, because it is necessary to use the image processing device with a wide dynamic range for the density,
Accordingly, an object of the present invention is, with due consideration to the drawbacks of the conventional technique, to provide an image processing device and an image processing method capable of automatically optimizing the block size of an reference area, of automatically performing an optimum enhancement of the contrast per region, and of easily obtaining output images without any occurrence of a chromaticity differentiation loss and jump in brightness, without any fearing of an unpleasantness, even if a non-skilled operator handles this image processing device and image processing method.
In accordance with a preferred embodiment of the present invention, an image processing device outputs image data to an output device. The image processing device comprises a region division means and a contrast enhancement means. The region division means inputs image data and for divides the input image data into a plurality of blocks, and further divides each block into a plurality of quasi blocks, and judges whether or not the further division is necessary for each block based on a degree of similarity of density histograms for the quasi blocks and sets quasi blocks as formal blocks based on the judgment. The judgment is repeated for all of the blocks in order to divide the input image data to the plurality of the blocks. The contrast enhancement means converts a density of each pixel in image data in each block obtained by the region division means based on a degree of enhancement in contrast according to a density property of each block.
In the image processing device of the present invention described above, the contrast enhancement means determines a clip value for each obtained block based on a slope of a tangent in proximity to a mean density of each obtained block on a property curve of an output system as the output device.
In the image processing device of the present invention described above, the contrast enhancement means determined a clip value for each obtained block based on a slope of a line that connects two points corresponding to a value of a mean densityxc2x1dispersion of each obtained block on a property curve of an output system as the output device.
In the image processing device of the present invention described above, the contrast enhancement means performs a density conversion for pixels in a region corresponding to a boundary section of the blocks by using a density curve obtained by a linear compensation of the density curve of each block after each block of more than the minimum size has been divided so that each divided block is equal in size to the block having the minimum size.
In the image processing device of the present invention described above, the contrast enhancement means obtains a difference of mean densities of each pair of blocks that are adjacent to each other in all of the blocks, makes pairs in four blocks in up-down direction and right-left direction, the four blocks being composed of a block including a target pixel and three blocks that are mostly adjacent to the block including the target pixel, judges whether or not the difference of the mean densities of each pair of the blocks is not less than a threshold value that has been set in advance, and decreases a degree of the contrast enhancement according to the number of the pairs of the blocks, whose difference of each pair of the blocks is not less than the threshold value.
In accordance with another preferred embodiment of the present invention, an image processing device outputs image data to an output device. The image processing device comprises a region division means and a contrast enhancement means. The region division means inputs image data and divides the input image data into a plurality of blocks. The contrast enhancement means converts a density of each pixel in image data in each block obtained by the region division means based on a degree of enhancement in contrast according to a density property of each pixel. In the image processing device, the contrast enhancement means determines a clip value of each block based on a property curve of the output system as a property of the output device and a mean density of each block.
In accordance with another preferred embodiment of the present invention, an image processing method outputs image data to an output device. The image processing method comprises the steps of: dividing the input image data into a plurality of blocks; temporarily dividing each block into a plurality of quasi blocks; obtaining a density histogram of each quasi block; judging whether or not a further division is necessary for each block based on a degree of similarity of density histograms for the quasi blocks, and setting quasi blocks as formal blocks based on the judgment; and repeating the judgment for the further division for all of the blocks in order to divide the input image data to the plurality of the blocks.
In accordance with another preferred embodiment of the present invention, an image processing method outputs image data to an output device. The image processing method comprises the steps of: dividing input image data into a plurality of blocks; obtaining a mean value of density values of pixels in each obtained block; obtaining a clip value to determine a degree of enhancement in contrast for each block based on the mean value of the density of each obtained block and a property curve of an output system as a property of the output device; obtaining a density histogram of each obtained block; and making a density conversion curve for each obtained block based on the density histogram and the clip value of each obtained block, and converting all of pixels in density based on the density conversion curve.
The image processing method described above, further comprises the steps of obtaining a difference of mean densities of each pair of blocks that are adjacent to each other in all of the obtained blocks, making block pairs in four blocks in up-down direction and right-left direction, the four blocks being composed of a block including a target pixel and three blocks that are mostly adjacent to the block including the target pixel, judging whether or not the difference of the mean densities of each block pair is not less than a threshold value that has been set in advance, and decreasing a clip value to determine a degree of enhancement in contrast according to the number of the pairs of the obtained blocks whose difference of the mean densities is not less than the threshold value.
In the image processing method described above, the blocks, whose size is greater than that of the block of the minimum size, located in a boundary region of the blocks are divided according to the block of the minimum size, and the density conversion is performed for pixels by using a density curve obtained by a linear compensation of the density curve of each divided block.
According to the present invention, input image are divided into a plurality of blocks automatically. At this time, it is judged whether or not the block is further divided according to a degree of the similarity of the density histograms of the blocks. If it is necessary to further divide the block, this block is divided into a plurality of blocks each having a small size. The division operation is repeated for all of the blocks. As a result, the input image is divided automatically into the blocks each having the optimum size. After the division process, the degree of enhancement in contrast is automatically determined per block in order to perform the density conversion for all of pixels. In this case, the mean density of the density values of pixels in each block is obtained, and then an optimum clip value to determine the degree of enhancement in contrast is automatically obtained per block according to the mean density per block and the property curve of an output system such as a printer. Then, the density conversion curve per block is made based on the density histogram and the clip value of each block and then the density conversion is performed for all of the pixels. Thereby, it is possible for an unskilled operator to perform the contrast enhancement of the input image data optimally.